home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Object Oriented Applicat…isualAge for C++ for OS/2
/
Object-Oriented Application Development with VisualAGE for C++ for OS2.iso
/
visual
/
vrsc.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-02-28
|
11KB
|
377 lines
/*REXX vrsc 1 d: e:\real */
/* PMSCRIPT.CMD Project Smarts install script for PM project
*
* Licensed Materials - Property of IBM
*
* "Restricted Materials of IBM"
*
* IBM WorkFrame
*
* (C) Copyright IBM Corp. 1995. All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with
* IBM Corp.
*
*/
/* trace all */
PARSE ARG component drive base
buyer = base'\BUYER'
common = base'\COMMON'
dacs = base'\DACSLIB'
help = base'\HELP'
property = base'\PROPERTY'
sale = base'\SALE'
service = base'\SERVICE'
say component
say drive
say base
say buyer
say common
say dacs
say help
say property
say sale
say service
/* Load the REXX utility functions. */
rc = RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs');
rc = SysLoadFuncs();
/* Load the Tools Setup utility functions */
rc = RxFuncAdd('IwfEnvPrfLoadFuncs', 'IWFPAPI', 'IwfRxEnvPrfLoadFuncs');
rc = IwfEnvPrfLoadFuncs();
rc = RxFuncAdd('iwfLoadFuncs', 'IWFREXX', 'iwfLoadFuncs');
rc = iwfLoadFuncs();
/* Initialize - use a global stem variable. */
stem = "stem"
cppdir = value('CPPMAIN',,'OS2ENVIRONMENT');
If cppdir=""
Then
signal Abort
Else
defprj=cppdir"\MAINPRJ\VACPP"
/* Look for the Desktop in use */
/* look for desktop in HPFS drive */
rc = SysFileTree(drive':\Visual Realty',dirspec,'SD');
say 'found 1:' dirspec.0
/* if not found, maybe it's a FAT drive */
if( dirspec.0 = 0 ) then
rc = SysFileTree(drive':\VISUAL_R',dirspec,'SD');
say 'found 2:' dirspec.0
loc = 0;
deskdir = ""
Do cnt=1 to dirspec.0 while loc = 0
parse var dirspec.cnt with a b c deskdir
deskdir = STRIP(deskdir, 'L')
loc = pos(drive':\Desktop', deskdir)
End /* End do*/
say deskdir
If component=3
Then
Do
rc = SysDestroyObject(base'\vbload.dat');
rc = SysDestroyObject(base'\property\vbload.dat');
rc = SysDestroyObject(base'\buyer\vbload.dat');
rc = SysDestroyObject(base'\service\vbload.dat');
rc = SysDestroyObject(base'\sale\vbload.dat');
rc = SysDestroyObject(base'\common\vbload.dat');
rc = SysFileTree(deskdir'\VRFULL',vrpr,'SF');
If (vrpr.0 <> 0)
Then
rc = SysDestroyObject(deskdir'\VRFULL');
rc = SysFileTree(deskdir'\VRBOOK',vrpr,'SF');
If (vrpr.0 = 0)
Then
rc = SysDestroyObject(deskdir'\DACSPRJ');
signal Close
End
If component=4
Then
Do
rc = SysDestroyObject(base'\vbload.dat');
rc = SysDestroyObject(base'\property\vbload.dat');
rc = SysDestroyObject(base'\service\vbload.dat');
rc = SysDestroyObject(base'\common\vbload.dat');
rc = SysFileTree(deskdir'\VRBOOK',vrpr,'SF');
If (vrpr.0 <> 0)
Then
rc = SysDestroyObject(deskdir'\VRBOOK');
rc = SysFileTree(deskdir'\VRFULL',vrpr,'SF');
If (vrpr.0 = 0)
Then
rc = SysDestroyObject(deskdir'\DACSPRJ');
signal Close
End
/* Create Main project */
If component=1
Then
stem.pszSourceProject = base'\VRFULL'
Else
stem.pszSourceProject = base'\VRBOOK'
/*
say base
say deskdir
say stem.pszSourceProject
*/
stem.pszTargetProject = ''
stem.pszTargetProjectSetup = 'PAMLOCATION:IWFBPAM='base';PAMDEFAULT:IWFBPAM='base';TARGETNAME=vrmain.exe;MAKEFILENAME=vrmain.mak;INHERITLIST='defprj';'
stem.pszTargetDirectory = ''
stem.pszTargetFolder = deskdir
rc = iwfCreateProjectFromProject(stem);
/* Create DACS project */
rc = SysFileTree(deskdir'\DACSPRJ',daxprj,'SF');
If (daxprj.0 = 0)
Then
Do
stem.pszSourceProject = base'\DACSPRJ'
stem.pszTargetProject = ''
stem.pszTargetProject = ''
stem.pszTargetProjectSetup = 'TARGETNAME=vrdacs.dll;MAKEFILENAME=vrdacs.mak;'
stem.pszTargetDirectory = ''
stem.pszTargetFolder = deskdir
rc = iwfCreateProjectFromProject(stem);
End
/* Modify Help project */
rc = SysSetObjectData(base"\Help1","PAMLOCATION:IWFBPAM="help);
rc = SysSetObjectData(base"\Help1","PAMDEFAULT:IWFBPAM="help);
rc = SysSetObjectData(base"\Help1","INHERITLIST="defprj);
/* Modify Property project */
rc = SysSetObjectData(base"\Propert","PAMLOCATION:IWFBPAM="property);
rc = SysSetObjectData(base"\Propert","PAMDEFAULT:IWFBPAM="property);
rc = SysSetObjectData(base"\Propert","INHERITLIST="defprj);
/* Modify Buyer project */
If component = 1
Then
Do
rc = SysSetObjectData(property"\Buyer","PAMLOCATION:IWFBPAM="buyer);
rc = SysSetObjectData(property"\Buyer","PAMDEFAULT:IWFBPAM="buyer);
rc = SysSetObjectData(property"\Buyer","INHERITLIST="defprj);
End
/* Modify Sale project */
If component = 1
Then
Do
rc = SysSetObjectData(buyer"\Sale","PAMLOCATION:IWFBPAM="sale);
rc = SysSetObjectData(buyer"\Sale","PAMDEFAULT:IWFBPAM="sale);
rc = SysSetObjectData(buyer"\Sale","INHERITLIST="defprj);
End
/* Modify Service project */
rc = SysSetObjectData(sale"\Service","PAMLOCATION:IWFBPAM="service);
rc = SysSetObjectData(sale"\Service","PAMDEFAULT:IWFBPAM="service);
rc = SysSetObjectData(sale"\Service","INHERITLIST="defprj);
/* Modify Common project */
rc = SysSetObjectData(service"\Common","PAMLOCATION:IWFBPAM="common);
rc = SysSetObjectData(service"\Common","PAMDEFAULT:IWFBPAM="common);
rc = SysSetObjectData(service"\Common","INHERITLIST="defprj);
/* Modify Dacslib project */
rc = SysSetObjectData(service"\Dacslib","PAMLOCATION:IWFBPAM="dacs);
rc = SysSetObjectData(service"\Dacslib","PAMDEFAULT:IWFBPAM="dacs);
rc = SysSetObjectData(service"\Dacslib","INHERITLIST="deskdir"\DACSPRJ");
/* Set up variable for the main project */
If component=1
Then
stem.pszProject = deskdir'\VRFULL'
Else
stem.pszProject = deskdir'\VRBOOK'
stem.pszName = 'HELP'
stem.pszValue = help';%HELP%'
rc = IwfAddVariable(stem);
stem.pszName= 'LIB'
If component=1
Then
stem.pszValue = buyer';'common';'dacs';'property';'sale';'service';%LIB%'
Else
stem.pszValue = common';'dacs';'property';'service';%LIB%'
rc = IwfAddVariable(stem);
stem.pszName = 'INCLUDE'
If component=1
Then
stem.pszValue = buyer';'common';'dacs';'property';'sale';'service';%INCLUDE%'
Else
stem.pszValue = common';'dacs';'property';'service';%INCLUDE%'
rc = IwfAddVariable(stem);
/* Set up variable for the property project */
stem.pszProject = base'\Propert'
stem.pszName= 'LIB'
If component=1
Then
stem.pszValue = buyer';'common';'dacs';'sale';'service';%LIB%'
Else
stem.pszValue = common';'dacs';'service';%LIB%'
rc = IwfAddVariable(stem);
stem.pszName = 'INCLUDE'
If component=1
Then
stem.pszValue = buyer';'common';'dacs';'sale';'service';%INCLUDE%'
Else
stem.pszValue = common';'dacs';'service';%INCLUDE%'
rc = IwfAddVariable(stem);
/* Set up variable for the Buyer project */
If component=1
Then
Do
stem.pszProject = property'\Buyer'
stem.pszName= 'LIB'
stem.pszValue = common';'dacs';'service';%LIB%'
rc = IwfAddVariable(stem);
stem.pszName = 'INCLUDE'
stem.pszValue = common';'dacs';'service';%INCLUDE%'
rc = IwfAddVariable(stem);
End
/* Set up variable for the Sale project */
If component=1
Then
Do
stem.pszProject = buyer'\Sale'
stem.pszName= 'LIB'
stem.pszValue = common';'dacs';'service';%LIB%'
rc = IwfAddVariable(stem);
stem.pszName = 'INCLUDE'
stem.pszValue = common';'dacs';'service';%INCLUDE%'
rc = IwfAddVariable(stem);
End
/* Set up variable for the Service project */
stem.pszProject = sale'\Service'
stem.pszName= 'LIB'
stem.pszValue = common';'dacs';%LIB%'
rc = IwfAddVariable(stem);
stem.pszName = 'INCLUDE'
stem.pszValue = common';'dacs';%INCLUDE%'
rc = IwfAddVariable(stem);
/* Building vbload.dat for Main project */
filename=base'\vbload.dat'
rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBMM.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
If component=1
Then
Do
rc = lineout(filename,base'\BUYER\VRBUY.VBB');
rc = lineout(filename,base'\SALE\VRSALE.VBB');
End
rc = lineout(filename,base'\PROPERTY\VRPROP.VBB');
rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
rc = lineout(filename);
/* Building vbload.dat for Property project */
filename=base'\property\vbload.dat'
rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBMM.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
If component=1
Then
Do
rc = lineout(filename,base'\BUYER\VRBUY.VBB');
rc = lineout(filename,base'\SALE\VRSALE.VBB');
End
rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
rc = lineout(filename);
/* Building vbload.dat for Buyer project */
filename=base'\buyer\vbload.dat'
rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
rc = lineout(filename);
/* Building vbload.dat for Sale project */
filename=base'\sale\vbload.dat'
rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
If component=1
Then
rc = lineout(filename,base'\BUYER\VRBUY.VBB');
rc = lineout(filename,base'\PROPERTY\VRPROP.VBB');
rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
rc = lineout(filename);
/* Building vbload.dat for Service project */
filename=base'\service\vbload.dat'
rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
rc = lineout(filename);
/* Building vbload.dat for Common project */
filename=base'\common\vbload.dat'
rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
rc = lineout(filename);
/* We are done. */
/* Close the installation console. */
/* Unload the environment profile functions */
Close:
rc = IwfEnvPrfDropFuncs();
rc = IwfDropFuncs();
exit(0);
/* VisualAge C++ not installed: Error!!!! */
Abort:
rc = IwfEnvPrfDropFuncs();
rc = IwfDropFuncs();
rc=RxMessageBox("VisualAge C++ is not properly installed on your system. The installation program cannot setup the Visual Realty projects. You must FIRST install VisualAge C++, then re-install the Visual Realty application.",,,);
exit(8)